<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="com.al.entity.Student" %>
<%@ page import="java.util.List" %>
<!DOCTYPE html>
<html>
	<head>
	<meta charset="UTF-8">
	<title>学生管理系统</title>
	<style  type ="text/css">
body {
		    width：100%；
			height: 100%;
			background-image: url(bg.png);
			background-repeat: no-repeat;
			background-size: 100%; 
		}
.show h1{
text-align: center;
color:white;
}

.show{
	width: 80%;
	margin: auto;
}
.show div{
text-align: center;
}
.show div button{
 border: 0;
background: none;
display: block;
margin: 20px auto;
text-align: center;
border: 2px solid #2ecc71;
padding: 10px 26px;
outline: none;
color: white;
border-radius: 24px;
transform: 0.25s;
cursor: pointer;
}
.show div button:hover{
background: #2ECC71;
}
.show div button a{
color:white;
text-decoration: none;
font-size:18px;
font-weight:800;
}
.show table{
	margin: auto;

}
.gridtable {
    font-family:  verdana,arial,sans-serif;
    font-size: 11px;
    color: #333333;
    border-width:  1px;
    border-color:  #666666;
    border-collapse:  collapse;
}
.gridtable th {
    border-width:  1px;
    padding:  8px;
    border-style:  solid;
    border-color:  #666666;
    background-color:  #dedede;
    font-size:20px;
}
.gridtable td {
    border-width:  1px;
    padding:  8px;
    border-style:  solid;
    border-color:  #666666;
    background-color:  #ffffff;
    font-size:20px;
}
.bt_d button{
 	border: 0;
	background: none;
	text-align: center;
	border: 2px solid #2ecc71;
	outline: none;
	color: black;
	border-radius: 24px;
	transform: 0.25s;
	cursor: pointer;
}
.bt_u button{
 	border: 0;
	background: none;
	text-align: center;
	border: 2px solid #2ecc71;
	outline: none;
	color: black;
	border-radius: 24px;
	transform: 0.25s;
	cursor: pointer;
}
.bt_d button:hover, .bt_u button:hover{
background: #2ECC71;
}

</style>
	</head>
	<body>
	<div class="show">
		<h1>学生信息管理系统</h1>
		<div><button type="button"><a href="add.jsp">添加学生</a></button></div>
		<br>
		<table class ="gridtable" >
			<tr>
			    <th>学号</th><th>姓名</th><th>年龄</th><th>性别</th><th>专业</th><th>电话</th><th>操作</th>
		    </tr>
		    <%
				List<Student> list = (List<Student>) request.getAttribute("list");
				for(Student student : list){
					
			%>
		   <tr>
				<td><%=student.getId() %></td>
				<td><%=student.getName() %></td>
				<td><%=student.getAge() %></td>
				<td><%=student.getGender() %></td>
				<td><%=student.getMajor() %></td>
				<td><%=student.getPhone() %></td>
				<td>
						<a class="bt_d" href="student?method=deleteById&id=<%=student.getId() %>"><button type="button">删除</button></a>
						<a class="bt_u" href="student?method=findById&id=<%=student.getId() %>"><button type="button">修改</button></a>
				</td>
			</tr>
			<%
				}
			%>
		</table>
	</div>
		
	</body>
</html>